package com.zhm.springcloud.controller;

import com.zhm.springcloud.domain.CommonResult;
import com.zhm.springcloud.service.AccountService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * Date： 2021/3/21 12:49
 *
 * @author ZHM
 */
@RestController
public class AccountController {

    @Resource
    AccountService accountService;

    /*
     *扣减账户余额
     */
    @GetMapping("/account/decrease")
    public CommonResult decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money) {
        accountService.decrease(userId, money);
        return new CommonResult(200, "扣减账户余额成功! ");
    }


}
